/*
							Copyright (C) 2010  Alourien Team
									
						This file is part of the Alourien Engine.

    The Alourien Engine is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    The Alourien Engine is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with the Alourien Engine.  If not, see <http://www.gnu.org/licenses/>.
	
 *File Name:Vector3Dimp.cpp
 *Programmer Name:Jose Castellano
 *Date of Last Update: 10/6/2010
 *
 *Purpose:This Program is to create a three dimensional 
 * Vector to be used in later programs
 *
 *Basic Info:It includes the vector set function which allows to
 * set all three values at once. Needs the Vector3D Header.
 *
 *UPDATES:
 *1)Created the Program and documentation.
 *  Date:10/1/2010 Updater: Jose Castellano
 *
 *2) Added the actual code to our Engine namespace
 *   Date: 10/06/2010 Updater: Manuel Cuellar
 *
 *
 */

#include "Vector3D.h"

namespace Alourien
{
	Vector3D::Vector3D(void)
	{
		x = 0;
		y = 0;
		z = 0;
	}


	Vector3D::~Vector3D(void)
	{
	}
	
	//This function is to get the values and set them into the vector
	//It allows for a faster initialization, rather than setting in the main
	//using three lines of code.
	void Vector3D::VectorSet(float xValue, float yValue, float zValue)
	{
		x = xValue;
		y = yValue;
		z = zValue;
	}
	
	//Overload of the + operator but for 3 Dimensional Vectors
	//Returns a 3 dimensional vector
	Vector3D Vector3D::operator+(const Vector3D& vector2) const
	{
		Vector3D tempData;

		tempData.x = this->x + vector2.x;
		tempData.y = this->y + vector2.y;
		tempData.z = this->z + vector2.z;

		return tempData;
	}

	//Overload of the * operator but for 3 Dimensional Vectors
	//Returns a 3 dimensional vector
	Vector3D Vector3D::operator*(const Vector3D& vector2) const
	{
		Vector3D tempData;

		tempData.x = this->x * vector2.x;
		tempData.y = this->y * vector2.y;
		tempData.z = this->z * vector2.z;

		return tempData;
	}
}
